﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using MyWeb.Data;
using MyWeb.Business;
using MyWeb.Common;

namespace MobileRecharge
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnLogin_Click(object sender, EventArgs e)
        {
            DataTable dt = tb_UserService.tb_User_GetByTop("", "Username='" + txtUsername.Text + "' and Password='" + txtPassword.Text+"' and Status=1", "");
            if (dt.Rows.Count > 0)
            {
                Session["Username"] = dt.Rows[0]["Username"].ToString();
                Session["Password"] = dt.Rows[0]["Password"].ToString();
                Response.Redirect("Recharge.aspx");
            }
            else
            {
                WebMsgBox.Show("Wrong Username or Password");
                return;
                
            }
        }
    }
}